package com.ffsky.template.demo.jsapi;

import android.webkit.JavascriptInterface;
import android.widget.Toast;

import com.gitee.hljdrl.dsbridge.basis.DSCallback;
import com.gitee.hljdrl.dsbridge.jsapi.DSPlugin;

import org.json.JSONException;



public class JsEchoApi extends DSPlugin {

    @JavascriptInterface
    public Object syn(Object args) throws JSONException {
        Toast.makeText(getContext(),"JsEchoApi syn",Toast.LENGTH_SHORT).show();
        return  args;
    }

    @JavascriptInterface
    public void asyn(Object args, DSCallback handler){
        Toast.makeText(getContext(),"JsEchoApi asyn",Toast.LENGTH_SHORT).show();
        handler.complete(args);
    }
}